package org.ne.banksys.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * @author wey
 * @date 2025/6/13 下午10:16 06
 **/

@Data
public class User {

    private Long customerId;
    // 自增列，无需验证

//    @NotBlank(message = "客户姓名不能为空")
    @Size(max = 50, message = "客户姓名长度不能超过50字符")
    private String customerName;

    // 严格校验身份证规则[1,5](@ref)
    private String PID;


    @JsonIgnore
    @NotBlank(message = "密码不能为空")
    private String password;

    private String address;
    // 可选字段，无需验证

    @NotBlank(message = "联系电话不能为空")
    @Pattern(
            regexp = "^1[3-9]\\d{9}$",
            message = "联系电话必须为11位有效手机号"
    )
    // 校验手机号格式[3,7](@ref)
    private String telephone;
}